#include <iostream>
using namespace std;

void swap(int * pa, int * pb) {
    int temp = *pa;
    *pa = *pb;
    *pb = temp;
    printf("pa: %p, &pa: %p\n", pa, &pa);
    printf("pb: %p, &pb: %p\n", pb, &pb);
}

int main() {
    int x = 10, y = 20;
    cout << "swap调用之前: x = " << x << ", y = " << y << endl;
    printf("&x: %p, &y:%p\n\n", &x, &y);
    swap(&x, &y);
    cout << "swap调用之后：x = " << x << ", y = " << y << endl;
    return 0;
}
